package bigdata.mapreduce.statistics;

import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

public class Map extends Mapper<Object,Text,IntWritable,IntWritable>{
	private IntWritable key=new IntWritable();
	private IntWritable value=new IntWritable();
	
	@Override
	public void map(Object key,Text value,Context context) throws IOException, InterruptedException {
		String[] strings=value.toString().split(",");
		
		this.key.set(Integer.parseInt(strings[0]));
		this.value.set(Integer.parseInt(strings[1]));		
		
		context.write(this.key, this.value);
	}
}